<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
    </script>
</head>
<body>

<select class="lev1">
    <option>请选择</option>
{volist name="data" id="v"}
    {if condition="$v.lev == 1 "}
    <option  value="{$v.pid}">{$v.pname}</option>
    {/if}
{/volist}
</select>

<select class="lev2">
    <option>请选择</option>
</select>

<select class="lev3">
    <option>请选择</option>
</select>
</body>
</html>
<script>
    $(".lev1").on('change',function () {
        var fid = $(this).val();
        var lev = $(this).prop('class');
        $.ajax({
            url:"http://www.yangxinpeng.com/level",
            data:{fid:fid,lev:lev},
            success:function (res) {
                console.log(res);
                var str = '<option>请选择</option>'
                for (const argument of res) {
                  str += " <option  value='"+argument.pid+"'>"+argument.pname+"</option>"
                }
                $(".lev2").html(str);
            }
        })
    })


    $(".lev2").on('change',function () {
        var fid = $(this).val();
        var lev = $(this).prop('class');
        $.ajax({
            url:"http://www.yangxinpeng.com/level",
            data:{fid:fid,lev:lev},
            success:function (res) {
                console.log(res);
                var str = '<option>请选择</option>'
                for (const argument of res) {
                    str += " <option  value='"+argument.pid+"'>"+argument.pname+"</option>"
                }
                $(".lev3").html(str);
            }
        })
    })
</script>